#include<stdio.h>
void findCombinations(int *nums,int size,int target,int start,int* current,int currentSize,int results[][100],int *returnSize);
int main()
{
	int nums[100],size,target;
	int start=0,current[100]={0},currentSize=0,returnSize=0;
	int results[100][100];
	scanf("%d %d",&size,&target);
	for(int i=0;i<size;i++)
	{
		scanf("%d",&nums[i]);
	}
	findCombinations(nums,size,target,start,current,currentSize,results,&returnSize);
	printf("%d\n",returnSize);
	for(int i=0;i<returnSize;i++)
	{
		for(int j=0;results[i][j]!=0&&j<size;j++)
		{
			printf("%d",results[i][j]);
			if(results[i][j+1]!=0)
			{
				printf(" ");
			}
		}
		printf("\n");
	}
	return 0;
}
void findCombinations(int *nums,int size,int target,int start,int* current,int currentSize,int results[][100],int *returnSize)
{
	if(target==0)
	{
		for(int i=0;i<currentSize;i++)
		{
			results[*returnSize][i]=current[i];
		}
		(*returnSize)++;
		return;
	}
	if(target<0||start>=size)
	{
		return;
	}
	for(int i=start;i<size;i++)
	{
		current[currentSize]=nums[i];
		findCombinations(nums,size,target-nums[i],i+1,current,currentSize+1,results,returnSize);
	}
}
